<html>
  <head>
    <title>肇新文档比对工具</title>
  </head>
  <body>
    <div
      style="
        height: 60px;
        line-height: 60px;
        text-align: center;
        font-size: 18px;
        font-weight: bold;
      "
    >
      pdf文档对比结果
    </div>
    <div style="height: calc(100vh - 100px); display: flex">
      <div style="flex: 1">
        <iframe
          id="oldFile"
          src=""
          width="100%"
          height="100%"
        ></iframe>
      </div>
      <div style="flex: 1">
        <iframe
          id="newFile"
          src=""
          width="100%"
          height="100%"
        ></iframe>
      </div>
    </div>
    <script>
      function getQueryVariable(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
          var pair = vars[i].split("=");
          if (pair[0] == variable) {
            return pair[1];
          }
        }
        return false;
      }

      function loadUrl(){
        document.getElementById("oldFile").src="./viewer.html?file="+getQueryVariable("file1");
        document.getElementById("newFile").src="./viewer.html?file="+getQueryVariable("file2");
      }
      loadUrl();
    </script>
  </body>
</html>
